﻿//------------------------------------------------------------
// GenericPool
// Copyright © 2025 Mao Yin Hang. All rights reserved.
//------------------------------------------------------------
namespace GenericPool
{
    public static class GenericReferencePool<T> where T : IReference, new()
    {
        private static ObjectPool<T> objectPool = new ObjectPool<T>(null, (a) => a.Clear());
        public static T Acquire()
        {
            return objectPool.Get();
        }
        public static void Release(T t)
        {
            objectPool.Release(t);
        }
    }
}
